<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>es6</title>
</head>
<body>
    
</body>
<script>
    // var str = '{"a":"1","b": "2","c":"3","d": {"e":"5","f":6,"g":"7"}}';
    // alert(str.a);
    // var str_json = JSON.parse(str);
    // document.write(str_json.a+"</br>");
    // document.write(str_json.b+"</br>");
    // document.write(str_json.c+"</br>");
    // document.write(str_json.d.e+"</br>");
    // document.write(str_json.d.f+"</br>");
    // document.write(str_json.d.g+"</br>");

function* fibs() {
  let a = 0;
  let b = 1;
  while (true) {
    yield a;
    [a, b] = [b, a + b];
  }
}

let [first, second, third, fourth, fifth, sixth] = fibs();
// sixth // 5
console.log(sixth);
</script>
</html>